package com.jt.mapper;

import com.jt.pojo.User;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;
import java.util.Map;

public interface UserMapper {

    List<User> findAll();

    @Select("select * from user where username=#{username} and password=#{password}")
    User findUserByUp(User user);
    @Select("select count(1) from user")
    long findTotal();

//    List<User> findUsetListByPage(@Param("start") int start,
//                                                            @Param("size") int size,
//                                                            @Param("query") String query);
        List<User> findUsetListByPage(Map map);

    @Update("update user set status=#{status} where id=#{id}")
    void updateStatusById(User user);


    void saveUser(User user);

    @Select("select * from user where id = #{id}")
    User findUserById(Integer id);


    void updateUser(User user);

    @Delete("delete from user where id=#{id}")
    void deleteUser(Integer id);


}
